package com.shiguo365.market.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.shiguo365.market.display.util.ToastUtils;

/**
 * Created by caomenglong on 16/8/20.
 */
public class MyDatabaseHelper extends SQLiteOpenHelper {

    public static final String name = "Shiguo365Market"; //数据库名称

    public static final int version = 1; //数据库版本

    public static final String CREATE_NOTIFICATION="CREATE TABLE IF NOT EXISTS  Notification("
        + "id INTEGER PRIMARY KEY AUTOINCREMENT, "
        + "notificationId TEXT, "
        + "title TEXT, "
        + "content TEXT, "
        + "extras TEXT, "
        + "creatTime TEXT);";

    private Context mContext;

    public MyDatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
        mContext=context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_NOTIFICATION);
        //ToastUtils.with(mContext).show("创建了数据库");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {

    }
}
